package Reflect;

import Reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("Reflect.Person");
        Method method1 = cls.getMethod("doSome");
        boolean mark1 = method1.isAnnotationPresent(AutoRunMethod.class);
        System.out.println(method1+"是否被标注了:"+mark1);
        Method method2 = cls.getMethod("sayHi");
        boolean mark2 = method2.isAnnotationPresent(AutoRunMethod.class);
        System.out.println(method2+"是否被标注了:"+mark2);
        Method method3 = cls.getMethod("watchTV");
        boolean mark3 = method3.isAnnotationPresent(AutoRunMethod.class);
        System.out.println(method3+"是否被标注了:"+mark3);
        Method method4 = cls.getMethod("playGame");
        boolean mark4 = method4.isAnnotationPresent(AutoRunMethod.class);
        System.out.println(method4+"是否被标注了:"+mark4);
    }
}
